Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add turbo_stream.refresh builder method #595

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

seanpdoyle
Copy link
Contributor

Closes #579

Extends the turbo_stream tag builder helper to create <turbo-stream action="refresh"> elements through the pre-existing turbo_stream_refresh_tag method.

@OlegChuev
Copy link

Hi guys! Any updates/plans/ETA for this PR to be merged?

@radanskoric
Copy link

Would be nice to have this merged.

@rubiii
Copy link

rubiii commented Jun 30, 2024

Anything we can do to help get this shipped?

Closes [hotwired#579][]

Extends the `turbo_stream` tag builder helper to create `<turbo-stream
action="refresh">` elements through the pre-existing
`turbo_stream_refresh_tag` method.

[hotwired#579]: hotwired#579
@seanpdoyle
Copy link
Contributor Author

@jorgemanrubia what do you think about expanding the Tag Builder interface to support [action="refresh"]?

@adrianthedev
Copy link

I was just looking for this method.
Not having it looks like the API is incomplete.
It forces devs to create turbo_stream.erb files instead of handling it in the controller.

@radanskoric
Copy link

I was just looking for this method. Not having it looks like the API is incomplete. It forces devs to create turbo_stream.erb files instead of handling it in the controller.

@adrianthedev, while I hope this gets merged soon, you can still do it in the controller:

respond_to do |format|
  format.turbo_stream { render turbo_stream: turbo_stream.action(:refresh, "") }
end

This is also useful if you have your own custom actions.

@brendon
Copy link

brendon commented Aug 21, 2024

This would be great to have, though in my experience, adding the request-id means that the browser will ignore the refresh request (just like it ignores broadcast refresh requests with a matching request-id), or does this only apply to streamed refresh requests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

refresh action is missing from Turbo::Streams::TagBuilder
6 participants